//! provide a CSP framework for develop.
//!
//!
//! e.g. We can create a game
//!
//! we need a main file that start a program.
//! ```no_run
//!
//!
//! #[the_world_game_core::main]
//! async fn main() {
//!     // all worker will be registered as services;
//!     // we can start them below
//!     Environment.run();
//!
//!     signal::ctrl_c().await.unwrap();
//! }
//!
//!
//! ```
//!
//! the 'enviroment' mod
//!```
//!use the_world_game_core::{
//!     {Worker, WorkerContextImpl, Handler},
//!      service_send_msg,
//!     spawn,
//! };
//! use the_world_game_derive::*;
//! use crate::sheep::Sheep;
//! use crate::wolf::Wolf;
//!
//!
//! /// environment worker
//! pub struct Environment;
//!
//! impl Worker for Environment {
//!     type Context = WorkerContextImpl<Self>;
//!
//!     fn started(&mut self, _ctx: &mut Self::Context) {
//!
//!        // ....
//!        println!("any work ");
//!
//!        // start a async work
//!         spawn(async {
//!         });
//!
//!
//!     }
//! }
//!
//! // message
//! // send msg to worker
//! #[derive(Message,Clone)]
//! pub struct DayMsg;
//!
//! // the jod that worker handle msg
//! impl Handler<DayMsg> for Environment {
//!     fn handle(&mut self, msg: DayMsg) {
//!        //
//!         service_send_msg::<Sheep, DayMsg>(msg.clone());
//!         service_send_msg::<Wolf, DayMsg>(msg);
//!     }
//! }
//!
//! ```
//!



mod worker_core;
mod message;
mod handler;
pub(crate) mod context;
pub(crate) mod envelop;

pub use worker_core::{Worker, WorkerSender,Running};
pub use message::Message;
pub use handler::Handler;
pub use context::WorkerContextImpl;

